import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import BusinessList from '../views/BusinessList.vue'
import BusinessInfo from '../views/BusinessInfo.vue'
import Login from '../views/Login.vue'
import Orders from '../views/Orders.vue'
import UserAddress from '../views/UserAddress.vue'
import Payment from '../views/Payment.vue'
import OrderList from '../views/OrderList.vue'
import AddUserAddress from '../views/AddUserAddress.vue'
import EditUserAddress from '../views/EditUserAddress.vue'
import Register from '../views/Register.vue'
import My from '../views/My.vue'
import PersonalData from '../views/PersonalData.vue'
import AddTx from '../views/AddTx.vue'
import Search from '../views/Search.vue'
import Wallet from '../views/Wallet.vue'
import Detailed from '../views/Detailed.vue'
import Cz from '../views/Cz.vue'
import Tx from '../views/Tx.vue'
import Account from '../views/Account.vue'
import Bind from '../views/Bind.vue'
import Integral from '../views/Integral.vue'
import After from '../views/After.vue'
import CreditDetail from '../views/CreditDetail.vue'
import Shuju from '../views/Shuju.vue'
Vue.use(VueRouter)

const routes = [{
		path: '/',
		name: 'Home',
		component: Index
	}, {
		path: '/index',
		name: 'Index',
		component: Index
	}, {
		path: '/businessList',
		name: 'BusinessList',
		component: BusinessList
	}, {
		path: '/businessInfo',
		name: 'BusinessInfo',
		component: BusinessInfo
	}, {
		path: '/login',
		name: 'Login',
		component: Login
	}, {
		path: '/orders',
		name: 'Orders',
		component: Orders
	}, {
		path: '/userAddress',
		name: 'UserAddress',
		component: UserAddress
	},
	{
		path: '/payment',
		name: 'Payment',
		component: Payment
	},
	{
		path: '/orderList',
		name: 'OrderList',
		component: OrderList
	},
	{
		path: '/addUserAddress',
		name: 'AddUserAddress',
		component: AddUserAddress
	}, {

		path: '/editUserAddress',
		name: 'EditUserAddress',
		component: EditUserAddress
	}, {
		path: '/register',
		name: 'Register',
		component: Register
	}, {
		path: '/my',
		name: 'My',
		component: My
	}, {
		path: '/personalData',
		name: 'PersonalData',
		component: PersonalData
	}, {
		path: '/addTx',
		name: 'AddTx',
		component: AddTx
	}, {
		path: '/search',
		name: 'Search',
		component: Search
	},{
		path: '/wallet',
		name: 'Wallet',
		component: Wallet
	},{
		path: '/detailed',
		name: 'Detailed',
		component: Detailed
	},{
		path: '/cz',
		name: 'Cz',
		component: Cz
	},{
		path: '/tx',
		name: 'Tx',
		component: Tx
	},{
		path: '/account',
		name: 'Account',
		component: Account
	},{
		path: '/bind',
		name: 'Bind',
		component: Bind
	},{
		path: '/integral',
		name: 'Integral',
		component: Integral
	},{
		path: '/after',
		name: 'After',
		component: After
	},{
		path: '/creditDetail',
		name: 'CreditDectail',
		component: CreditDetail
	},{
		path: '/shuju',
		name: 'Shuju',
		component: Shuju
	},

]

//解决重复路由报异常问题
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})
export default router
